-
Notifications
You must be signed in to change notification settings - Fork 2.4k
fix: correct Claude Sonnet 4.5 model ID format #8373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Changed 'anthropic/claude-4.5-sonnet' to 'anthropic/claude-sonnet-4.5' to match the correct naming convention where the version number comes after 'sonnet'. Updated in: - packages/types/src/providers/openrouter.ts (3 occurrences) - src/api/providers/fetchers/__tests__/openrouter.spec.ts (4 occurrences)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some small improvements worth considering. Inline comments summarize minor suggestions.
| "anthropic/claude-3.7-sonnet:thinking", | ||
| "anthropic/claude-sonnet-4", | ||
| "anthropic/claude-4.5-sonnet", | ||
| "anthropic/claude-sonnet-4.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] The corrected ID matches OpenRouter’s Anthropic naming convention. Consider adding a brief comment above these sets to document the expected pattern (e.g., anthropic/claude-sonnet-4.x) to prevent regressions.
| "google/gemini-2.5-flash-lite-preview-06-17", // OpenRouter doesn't report this as supporting prompt caching | ||
| "anthropic/claude-opus-4.1", // Not yet available in OpenRouter API | ||
| "anthropic/claude-4.5-sonnet", // Not yet available in OpenRouter API | ||
| "anthropic/claude-sonnet-4.5", // Not yet available in OpenRouter API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] This model ID is excluded in several places below as well. To avoid drift, consider extracting shared exclusions (like anthropic/claude-sonnet-4.5 while unavailable) into a single constant used across these sections.
Description
Fixed incorrect model ID format for Claude Sonnet 4.5 in OpenRouter provider.
Changes
anthropic/claude-4.5-sonnettoanthropic/claude-sonnet-4.5to match the correct naming convention where the version number comes after 'sonnet'packages/types/src/providers/openrouter.ts(3 occurrences in OPEN_ROUTER_PROMPT_CACHING_MODELS, OPEN_ROUTER_COMPUTER_USE_MODELS, and OPEN_ROUTER_REASONING_BUDGET_MODELS)src/api/providers/fetchers/__tests__/openrouter.spec.ts(4 occurrences in test exclusion lists)Testing
anthropic/claude-sonnet-4,anthropic/claude-3.5-sonnet)Note
The model is currently excluded from OpenRouter API tests as it's not yet available in their API, but the correct format is now in place for when it becomes available.
Important
Corrects Claude Sonnet 4.5 model ID format in
openrouter.tsandopenrouter.spec.tsto ensure consistency and future API compatibility.anthropic/claude-4.5-sonnettoanthropic/claude-sonnet-4.5.openrouter.tsforOPEN_ROUTER_PROMPT_CACHING_MODELS,OPEN_ROUTER_COMPUTER_USE_MODELS, andOPEN_ROUTER_REASONING_BUDGET_MODELS.openrouter.spec.tsfor test exclusion lists.anthropic/claude-sonnet-4).This description was created by
for b832e92. You can customize this summary. It will automatically update as commits are pushed.